/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package operators;

import genotypes.AnglesPopulation;

/**
 *
 * @author rusak
 */
public class SplitSelection implements SplitOperator {

    int unacceptableSize, popSize;

    public SplitSelection(int unacceptableSize,  int popSize) {
        this.unacceptableSize = unacceptableSize;
        this.popSize = popSize;
    }
    
    
    public void setUnacceptableSize(int unacceptableSize) {
        this.unacceptableSize= unacceptableSize;
    }
    @Override
    public AnglesPopulation[] split(AnglesPopulation pop1, AnglesPopulation pop2) {
      
        AnglesPopulation accPop = AnglesPopulation.merge(pop1.getAcceptable(), pop2.getAcceptable());
      //  System.out.print("ACC: \n"+accPop+"\n");
        AnglesPopulation unaccPop = AnglesPopulation.merge(pop1.getUnacceptable(), pop2.getUnacceptable());
      //  System.out.print("ACC: \n"+unaccPop+"\n");
        
        return new AnglesPopulation[] {accPop, unaccPop};
    }
}
